home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / pff1_3 / pffsel.frm < prev    next >
Text File  |  1995-05-08  |  8KB  |  317 lines

  1. VERSION 2.00
  2. Begin Form Selection 
  3.    BackColor       =   &H00808080&
  4.    Caption         =   "PFF for Windows"
  5.    ClientHeight    =   3990
  6.    ClientLeft      =   1005
  7.    ClientTop       =   1470
  8.    ClientWidth     =   4485
  9.    FillStyle       =   3  'Vertical Line
  10.    ForeColor       =   &H00000000&
  11.    Height          =   4395
  12.    Icon            =   PFFSEL.FRX:0000
  13.    Left            =   945
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    ScaleHeight     =   3990
  18.    ScaleWidth      =   4485
  19.    Top             =   1125
  20.    Width           =   4605
  21.    Begin CommandButton AllDone 
  22.       BackColor       =   &H00808080&
  23.       Caption         =   "E&xit"
  24.       Height          =   375
  25.       Left            =   3120
  26.       TabIndex        =   7
  27.       Top             =   3480
  28.       Width           =   1095
  29.    End
  30.    Begin CommandButton PrintFile 
  31.       BackColor       =   &H00808080&
  32.       Caption         =   "&Print File"
  33.       Height          =   375
  34.       Left            =   240
  35.       TabIndex        =   6
  36.       Top             =   3480
  37.       Width           =   1095
  38.    End
  39.    Begin PictureBox Picture1 
  40.       BackColor       =   &H00000000&
  41.       Enabled         =   0   'False
  42.       Height          =   510
  43.       Left            =   1425
  44.       Picture         =   PFFSEL.FRX:0302
  45.       ScaleHeight     =   480
  46.       ScaleWidth      =   495
  47.       TabIndex        =   9
  48.       Top             =   3345
  49.       Width           =   525
  50.    End
  51.    Begin CheckBox LineNum 
  52.       BackColor       =   &H00808080&
  53.       Caption         =   "Line &Numbers"
  54.       ForeColor       =   &H0000FF00&
  55.       Height          =   255
  56.       Left            =   1470
  57.       TabIndex        =   3
  58.       Top             =   3045
  59.       Value           =   1  'Checked
  60.       Width           =   1530
  61.    End
  62.    Begin CommandButton FileEdit 
  63.       BackColor       =   &H00808080&
  64.       Caption         =   "&Edit File"
  65.       Height          =   375
  66.       Left            =   3120
  67.       TabIndex        =   8
  68.       Top             =   3000
  69.       Width           =   1095
  70.    End
  71.    Begin CommandButton ViewFile 
  72.       BackColor       =   &H00808080&
  73.       Caption         =   "&View File"
  74.       Height          =   375
  75.       Left            =   240
  76.       TabIndex        =   5
  77.       Top             =   3000
  78.       Width           =   1095
  79.    End
  80.    Begin DriveListBox Drive1 
  81.       BackColor       =   &H00FFFFFF&
  82.       ForeColor       =   &H00000000&
  83.       Height          =   315
  84.       Left            =   240
  85.       TabIndex        =   1
  86.       Top             =   2565
  87.       Width           =   3975
  88.    End
  89.    Begin FileListBox File1 
  90.       BackColor       =   &H00FFFFFF&
  91.       ForeColor       =   &H00000000&
  92.       Height          =   1980
  93.       Left            =   2520
  94.       TabIndex        =   4
  95.       Top             =   495
  96.       Width           =   1695
  97.    End
  98.    Begin TextBox CurrentFile 
  99.       BackColor       =   &H00FFFFFF&
  100.       ForeColor       =   &H00000000&
  101.       Height          =   315
  102.       Left            =   2520
  103.       MousePointer    =   3  'I-Beam
  104.       TabIndex        =   2
  105.       Text            =   "*.*"
  106.       Top             =   120
  107.       Width           =   1695
  108.    End
  109.    Begin DirListBox Dir1 
  110.       BackColor       =   &H00FFFFFF&
  111.       Height          =   2355
  112.       Left            =   240
  113.       TabIndex        =   0
  114.       Top             =   120
  115.       Width           =   2175
  116.    End
  117.    Begin Label Label1 
  118.       BackColor       =   &H00808080&
  119.       Caption         =   "AmSoft Development"
  120.       FontBold        =   0   'False
  121.       FontItalic      =   0   'False
  122.       FontName        =   "MS Sans Serif"
  123.       FontSize        =   8.25
  124.       FontStrikethru  =   0   'False
  125.       FontUnderline   =   0   'False
  126.       ForeColor       =   &H00C0C000&
  127.       Height          =   435
  128.       Left            =   2040
  129.       TabIndex        =   10
  130.       Top             =   3465
  131.       Width           =   1035
  132.    End
  133. End
  134.  
  135.  
  136. Sub AllDone_Click ()
  137.     
  138.     If nCid% <> 0 Then Result% = CloseComm(nCid%)
  139.     End
  140.  
  141. End Sub
  142.  
  143. ' This sub works well only with VGA displays.  For EGA
  144. ' displays, you will want to modify the backcolor
  145. ' properties for the form and controls, and avoid this
  146. ' procedure.
  147. '
  148. Sub BorderBox (Source As Control, Action As Integer)
  149.     BLeft% = Source.Left - 20     ' Get coordinates
  150.     BTop% = Source.Top - 20
  151.     BWide% = Source.Width + 18
  152.     BHigh% = Source.Height + 18
  153.     ' Action TRUE means draw, FALSE means erase
  154.     If Action Then
  155.         ' Draw a recessed border around Source control
  156.         Line (BLeft%, BTop%)-Step(BWide%, 0), 0
  157.         Line -Step(0, BHigh%), RGB(255, 255, 255)
  158.         Line -Step(-BWide%, 0), RGB(255, 255, 255)
  159.         Line -Step(0, -BHigh%), 0
  160.     Else
  161.         ' Erase border around Source control
  162.         Line (BLeft%, BTop%)-Step(BWide%, 0), Backcolor
  163.         Line -Step(0, BHigh%), Backcolor
  164.         Line -Step(-BWide%, 0), Backcolor
  165.         Line -Step(0, -BHigh%), Backcolor
  166.     End If
  167. End Sub
  168.  
  169. Sub CurrentFile_KeyPress (KeyAscii As Integer)
  170.  
  171.     On Error GoTo GetError
  172.     If KeyAscii = 13 Then
  173.         File1.FileName = CurrentFile.Text
  174.     End If
  175.     On Error GoTo 0
  176.     Exit Sub
  177.     
  178. GetError:
  179.  
  180.     If Err > 0 Then
  181.         CurrentFile.Text = "*.txt, *.bat, *.me"
  182.         File1.FileName = CurrentFile.Text
  183.     End If
  184.     Resume Next
  185.  
  186. End Sub
  187.  
  188. Sub Dir1_Change ()
  189.  
  190.     File1.Path = Dir1.Path
  191.     ' File1.SetFocus
  192.     If File1.ListCount Then File1.ListIndex = 0
  193.     ChDir File1.Path
  194.     
  195. End Sub
  196.  
  197. Sub Dir1_Click ()
  198.  
  199.     lastchange = DIRSBOXCLICK
  200.     File1.FileName = "*.TXT;*.ME;*.1ST;*.BAT"
  201.  
  202. End Sub
  203.  
  204. Sub Drive1_Change ()
  205.  
  206.     Dir1.Path = Drive1.Drive
  207.  
  208. End Sub
  209.  
  210. Sub File1_Click ()
  211.  
  212.     lastchange = FILEBOXCLICK
  213.     CurrentFile.Text = File1.FileName
  214.  
  215. End Sub
  216.  
  217. Sub File1_DblClick ()
  218.     
  219.     CurrentFile.Text = File1.FileName
  220.     ViewFile_Click
  221.     'ViewFile.SetFocus
  222.  
  223. End Sub
  224.  
  225. Sub FileEdit_Click ()
  226.  
  227.     If File1.FileName = "" Then
  228.         Beep
  229.         MsgBox "No file specified.", 64, "I Need a File"
  230.         Exit Sub
  231.     End If
  232.     ChDrive Drive1.Drive
  233.     ChDir File1.Path
  234.     
  235.     x = Shell("notepad.exe " + CurrentFile.Text, 1)
  236.  
  237. End Sub
  238.  
  239. Sub Form_Load ()
  240.     
  241.     Show
  242.     ViewFile.SetFocus
  243.     CurrentFile.Text = "*.TXT;*.ME;*.1ST;*.BAT"
  244.     File1.FileName = "*.TXT;*.ME;*.1ST;*.BAT"
  245.     BorderBox CurrentFile, True
  246.     BorderBox Drive1, True
  247.     BorderBox Dir1, True
  248.     BorderBox File1, True
  249.     BorderBox Picture1, True
  250.  
  251. End Sub
  252.  
  253. Sub Form_Paint ()
  254.     
  255.     BorderBox CurrentFile, True
  256.     BorderBox Drive1, True
  257.     BorderBox Dir1, True
  258.     BorderBox File1, True
  259.     BorderBox Picture1, True
  260.  
  261. End Sub
  262.  
  263. Sub Form_Unload (Cancel As Integer)
  264.  
  265.     End
  266.  
  267. End Sub
  268.  
  269. Sub LineNum_Click ()
  270.  
  271.     If LineNum.Value = 1 Then
  272.         Lines = True
  273.     Else
  274.         Lines = False
  275.     End If
  276.  
  277. End Sub
  278.  
  279. Sub PrintFile_Click ()
  280.  
  281.     ChDrive Drive1.Drive
  282.     ChDir File1.Path
  283.     MyFile$ = File1.FileName
  284.     Selection.MousePointer = 11
  285.     FormatFile MyFile$
  286.     Selection.MousePointer = 0
  287.  
  288. End Sub
  289.  
  290. Sub SetDraft_Click ()
  291.  
  292.     LineNum.Enabled = 0  ' Grey the line number choice
  293.     PRETTYPRINT = False
  294.  
  295. End Sub
  296.  
  297. Sub SetPretty_Click ()
  298.  
  299.     PRETTYPRINT = True
  300.     LineNum.Enabled = 1
  301.  
  302. End Sub
  303.  
  304. Sub ViewFile_Click ()
  305.  
  306.     If File1.FileName = "" Then
  307.         Beep
  308.         MsgBox "No file specified.", 64, "I Need a File"
  309.         Exit Sub
  310.     End If
  311.     Selection.Hide
  312.     Viewer.Show MODAL
  313.     Selection.Show
  314.     
  315. End Sub
  316.  
  317.